package com.learn.ioc.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class SoldierController {
    SoldierService soldierService;

    public void SoldierService() {
        System.out.println("无参构造器调用");
    }
    public SoldierController(SoldierService soldierService) {
        this.soldierService = soldierService;
    }

    public SoldierService getSoldierService() {
        return soldierService;
    }

    public void setSoldierService(SoldierService soldierService) {
        System.out.println("set method is invoked");
        this.soldierService = soldierService;
    }

    public void getMessage() {
        soldierService.getMessage();
    }
}
